home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Updated!__2154746112009.psc / Decimal Clock Ver 2.0 / About.frm
Text File  |  2009-06-12  |  17KB  |  443 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAbout 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    ClientHeight    =   2865
  5.    ClientLeft      =   2340
  6.    ClientTop       =   1935
  7.    ClientWidth     =   4995
  8.    ClipControls    =   0   'False
  9.    KeyPreview      =   -1  'True
  10.    LockControls    =   -1  'True
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   191
  14.    ScaleMode       =   3  'Pixel
  15.    ScaleWidth      =   333
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   1  'CenterOwner
  18.    WhatsThisHelp   =   -1  'True
  19.    Begin VB.CommandButton cmdOK 
  20.       BackColor       =   &H00C0C0C0&
  21.       Caption         =   "&OK"
  22.       BeginProperty Font 
  23.          Name            =   "Tahoma"
  24.          Size            =   8.25
  25.          Charset         =   0
  26.          Weight          =   400
  27.          Underline       =   0   'False
  28.          Italic          =   0   'False
  29.          Strikethrough   =   0   'False
  30.       EndProperty
  31.       Height          =   345
  32.       Left            =   3660
  33.       MaskColor       =   &H00FFFFFF&
  34.       TabIndex        =   0
  35.       Top             =   1680
  36.       UseMaskColor    =   -1  'True
  37.       WhatsThisHelpID =   10028
  38.       Width           =   1200
  39.    End
  40.    Begin VB.CommandButton cmdSysInfo 
  41.       BackColor       =   &H0000FFFF&
  42.       Caption         =   "&System Info..."
  43.       BeginProperty Font 
  44.          Name            =   "Tahoma"
  45.          Size            =   8.25
  46.          Charset         =   0
  47.          Weight          =   400
  48.          Underline       =   0   'False
  49.          Italic          =   0   'False
  50.          Strikethrough   =   0   'False
  51.       EndProperty
  52.       Height          =   345
  53.       Left            =   3660
  54.       MaskColor       =   &H000000FF&
  55.       TabIndex        =   1
  56.       Top             =   2100
  57.       UseMaskColor    =   -1  'True
  58.       WhatsThisHelpID =   10029
  59.       Width           =   1215
  60.    End
  61.    Begin VB.Label lblDescriptionApp 
  62.       AutoSize        =   -1  'True
  63.       BeginProperty Font 
  64.          Name            =   "Tahoma"
  65.          Size            =   8.25
  66.          Charset         =   0
  67.          Weight          =   400
  68.          Underline       =   0   'False
  69.          Italic          =   0   'False
  70.          Strikethrough   =   0   'False
  71.       EndProperty
  72.       ForeColor       =   &H00000000&
  73.       Height          =   195
  74.       Left            =   1320
  75.       TabIndex        =   10
  76.       Top             =   435
  77.       WhatsThisHelpID =   10033
  78.       Width           =   45
  79.    End
  80.    Begin VB.Label lblDescription 
  81.       BeginProperty Font 
  82.          Name            =   "Tahoma"
  83.          Size            =   8.25
  84.          Charset         =   0
  85.          Weight          =   400
  86.          Underline       =   0   'False
  87.          Italic          =   0   'False
  88.          Strikethrough   =   0   'False
  89.       EndProperty
  90.       ForeColor       =   &H00000000&
  91.       Height          =   870
  92.       Left            =   60
  93.       TabIndex        =   2
  94.       Top             =   1620
  95.       WhatsThisHelpID =   10030
  96.       Width           =   3465
  97.    End
  98.    Begin VB.Label lblLCopyr 
  99.       BeginProperty Font 
  100.          Name            =   "Tahoma"
  101.          Size            =   8.25
  102.          Charset         =   0
  103.          Weight          =   400
  104.          Underline       =   0   'False
  105.          Italic          =   0   'False
  106.          Strikethrough   =   0   'False
  107.       EndProperty
  108.       ForeColor       =   &H00000000&
  109.       Height          =   510
  110.       Left            =   60
  111.       TabIndex        =   9
  112.       Top             =   1140
  113.       WhatsThisHelpID =   10038
  114.       Width           =   4845
  115.    End
  116.    Begin VB.Label lblTitel 
  117.       BeginProperty Font 
  118.          Name            =   "Tahoma"
  119.          Size            =   14.25
  120.          Charset         =   0
  121.          Weight          =   700
  122.          Underline       =   0   'False
  123.          Italic          =   0   'False
  124.          Strikethrough   =   0   'False
  125.       EndProperty
  126.       ForeColor       =   &H00000000&
  127.       Height          =   465
  128.       Left            =   1320
  129.       TabIndex        =   8
  130.       Top             =   120
  131.       WhatsThisHelpID =   10037
  132.       Width           =   3585
  133.    End
  134.    Begin VB.Label lblVersion 
  135.       BeginProperty Font 
  136.          Name            =   "Tahoma"
  137.          Size            =   8.25
  138.          Charset         =   0
  139.          Weight          =   700
  140.          Underline       =   0   'False
  141.          Italic          =   0   'False
  142.          Strikethrough   =   0   'False
  143.       EndProperty
  144.       ForeColor       =   &H00000000&
  145.       Height          =   225
  146.       Left            =   1320
  147.       TabIndex        =   7
  148.       Top             =   675
  149.       WhatsThisHelpID =   10036
  150.       Width           =   3585
  151.    End
  152.    Begin VB.Label lblWebPage 
  153.       AutoSize        =   -1  'True
  154.       BeginProperty Font 
  155.          Name            =   "Tahoma"
  156.          Size            =   8.25
  157.          Charset         =   0
  158.          Weight          =   400
  159.          Underline       =   -1  'True
  160.          Italic          =   0   'False
  161.          Strikethrough   =   0   'False
  162.       EndProperty
  163.       ForeColor       =   &H00000000&
  164.       Height          =   195
  165.       Index           =   1
  166.       Left            =   2760
  167.       MousePointer    =   14  'Arrow and Question
  168.       TabIndex        =   6
  169.       ToolTipText     =   "Send me a mail..."
  170.       Top             =   2580
  171.       WhatsThisHelpID =   10035
  172.       Width           =   45
  173.    End
  174.    Begin VB.Label Label2 
  175.       AutoSize        =   -1  'True
  176.       Caption         =   "@:"
  177.       BeginProperty Font 
  178.          Name            =   "Tahoma"
  179.          Size            =   8.25
  180.          Charset         =   0
  181.          Weight          =   400
  182.          Underline       =   0   'False
  183.          Italic          =   0   'False
  184.          Strikethrough   =   0   'False
  185.       EndProperty
  186.       ForeColor       =   &H00000000&
  187.       Height          =   195
  188.       Index           =   2
  189.       Left            =   2505
  190.       TabIndex        =   5
  191.       Top             =   2580
  192.       WhatsThisHelpID =   10034
  193.       Width           =   210
  194.    End
  195.    Begin VB.Label Label2 
  196.       AutoSize        =   -1  'True
  197.       Caption         =   "URL:"
  198.       BeginProperty Font 
  199.          Name            =   "Tahoma"
  200.          Size            =   8.25
  201.          Charset         =   0
  202.          Weight          =   400
  203.          Underline       =   0   'False
  204.          Italic          =   0   'False
  205.          Strikethrough   =   0   'False
  206.       EndProperty
  207.       ForeColor       =   &H00000000&
  208.       Height          =   195
  209.       Index           =   1
  210.       Left            =   60
  211.       TabIndex        =   4
  212.       Top             =   2580
  213.       WhatsThisHelpID =   10033
  214.       Width           =   345
  215.    End
  216.    Begin VB.Label lblWebPage 
  217.       BeginProperty Font 
  218.          Name            =   "Tahoma"
  219.          Size            =   8.25
  220.          Charset         =   0
  221.          Weight          =   400
  222.          Underline       =   -1  'True
  223.          Italic          =   0   'False
  224.          Strikethrough   =   0   'False
  225.       EndProperty
  226.       ForeColor       =   &H00000000&
  227.       Height          =   195
  228.       Index           =   0
  229.       Left            =   480
  230.       MousePointer    =   14  'Arrow and Question
  231.       TabIndex        =   3
  232.       ToolTipText     =   "Go to the webpage..."
  233.       Top             =   2580
  234.       WhatsThisHelpID =   10031
  235.       Width           =   1815
  236.    End
  237.    Begin VB.Image Img 
  238.       Height          =   1050
  239.       Index           =   0
  240.       Left            =   60
  241.       Stretch         =   -1  'True
  242.       Top             =   60
  243.       WhatsThisHelpID =   10027
  244.       Width           =   1050
  245.    End
  246.    Begin VB.Line Line1 
  247.       BorderColor     =   &H00808080&
  248.       BorderStyle     =   6  'Inside Solid
  249.       Index           =   1
  250.       X1              =   2
  251.       X2              =   328
  252.       Y1              =   167
  253.       Y2              =   167
  254.    End
  255.    Begin VB.Line Line1 
  256.       BorderColor     =   &H00FFFFFF&
  257.       BorderWidth     =   2
  258.       Index           =   0
  259.       X1              =   3
  260.       X2              =   328
  261.       Y1              =   168
  262.       Y2              =   168
  263.    End
  264. End
  265. Attribute VB_Name = "frmAbout"
  266. Attribute VB_GlobalNameSpace = False
  267. Attribute VB_Creatable = False
  268. Attribute VB_PredeclaredId = True
  269. Attribute VB_Exposed = False
  270. Option Explicit
  271. Private Const C_Support$ = "Pappsegull"
  272. Private Const C_CopyR$ = "Copyright⌐  2009 " & c_Mail
  273. ' Reg Key Security Options...
  274. Private Const READ_CONTROL = &H20000
  275. Private Const KEY_QUERY_VALUE = &H1
  276. Private Const KEY_SET_VALUE = &H2
  277. Private Const KEY_CREATE_SUB_KEY = &H4
  278. Private Const KEY_ENUMERATE_SUB_KEYS = &H8
  279. Private Const KEY_NOTIFY = &H10
  280. Private Const KEY_CREATE_LINK = &H20
  281. Private Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
  282.                        KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
  283.                        KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL
  284.                      
  285. ' Reg Key ROOT Types...
  286. Private Const HKEY_LOCAL_MACHINE = &H80000002
  287. Private Const ERROR_SUCCESS = 0
  288. Private Const REG_SZ = 1                         ' Unicode nul terminated string
  289. Private Const REG_DWORD = 4                      ' 32-bit number
  290.  
  291. Private Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
  292. Private Const gREGVALSYSINFOLOC = "MSINFO"
  293. Private Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
  294. Private Const gREGVALSYSINFO = "PATH"
  295. Private Declare Function OSRegDeleteKey Lib "advapi32" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpszSubKey As String) As Long
  296. Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long
  297. Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
  298. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  299.  
  300. Private Sub Form_Load()
  301.     lblTitel = App.Title: Caption = "About " & App.Title
  302.     lblDescriptionApp = App.FileDescription
  303.     lblVersion.Caption = "Version " & sVerNow$
  304.     lblLCopyr = "WARNING: This computor program is protected by copyright law and international treaties."
  305.     lblDescription = "THIS IS A FREE SOFTWARE (FREEWARE) including source code." & vbLf & vbLf & C_CopyR$
  306.     lblWebPage(0) = c_URL: lblWebPage(1) = c_Mail
  307.     Me.Icon = frmS.Icon: Img(0) = frmS.Img(0): SetTopMost hwnd, True
  308. End Sub
  309.  
  310. Private Sub cmdSysInfo_Click()
  311.   Call StartSysInfo
  312. End Sub
  313.  
  314. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  315.     If KeyCode = 27 Then Unload Me 'Esc
  316. End Sub
  317.  
  318. Private Sub cmdOK_Click()
  319.   Unload Me
  320. End Sub
  321.  
  322. Private Sub lblWebPage_Click(Index As Integer)
  323.     Contact lblWebPage(Index)
  324. End Sub
  325.  
  326. Private Sub lblWebPage_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  327.     Color vbBlue
  328. End Sub
  329.  
  330. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  331.     Color vbBlack
  332. End Sub
  333.  
  334. Sub Color(C&): Dim Z%
  335.     For Z% = 0 To 1
  336.         lblWebPage(Z%).ForeColor = C&
  337.     Next
  338. End Sub
  339.  
  340. Sub Contact(URLUrMail$)
  341. Dim s$, n$, X& 'Go to URL or send e-mail
  342.     s$ = IIf(InStr(1, URLUrMail$, "@") > 0, _
  343.       "mailto:Pappsegull Sweden <" & URLUrMail$ & ">", _
  344.       "http://" & URLUrMail$)
  345.     If Left$(s$, 1) = "m" Then 'Mail
  346.         s$ = s$ & "?subject=" & App.Title & " Ver: " & sVerNow$
  347.     End If
  348.     RunCommand s$
  349. End Sub
  350. Private Sub Form_Unload(Cancel As Integer)
  351.     Hide
  352.     If MsgBox("Do you like to vote for my code?", 36 + vbSystemModal) = vbYes Then
  353.         MsgBox "Thanks! :-)", 64 + vbSystemModal: Contact lblWebPage(0)
  354.     End If
  355.     Unload Me: Set frmAbout = Nothing
  356. End Sub
  357.  
  358. Public Sub StartSysInfo()
  359.     On Error GoTo SysInfoErr
  360.     Dim rc As Long
  361.     Dim SysInfoPath As String
  362.     
  363.     ' Try To Get System Info Program Path\Name From Registry...
  364.     If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
  365.     ' Try To Get System Info Program Path Only From Registry...
  366.     ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
  367.         ' Validate Existance Of Known 32 Bit File Version
  368.         If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
  369.             SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
  370.             
  371.         ' Error - File Can Not Be Found...
  372.         Else
  373.             GoTo SysInfoErr
  374.         End If
  375.     ' Error - Registry Entry Can Not Be Found...
  376.     Else
  377.         GoTo SysInfoErr
  378.     End If
  379.     
  380.     Call Shell(SysInfoPath, vbNormalFocus)
  381.     Screen.ActiveControl.Refresh
  382.     
  383.     Exit Sub
  384. SysInfoErr:
  385.     MsgBox Err.Description, 16 + vbSystemModal
  386. End Sub
  387.  
  388. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
  389.     Dim i As Long                                           ' Loop Counter
  390.     Dim rc As Long                                          ' Return Code
  391.     Dim hKey As Long                                        ' Handle To An Open Registry Key
  392.     Dim hDepth As Long                                      '
  393.     Dim KeyValType As Long                                  ' Data Type Of A Registry Key
  394.     Dim tmpVal As String                                    ' Tempory Storage For A Registry Key Value
  395.     Dim KeyValSize As Long                                  ' Size Of Registry Key Variable
  396.     '------------------------------------------------------------
  397.     ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
  398.     '------------------------------------------------------------
  399.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
  400.     
  401.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Error...
  402.     
  403.     tmpVal = String$(1024, 0)                               ' Allocate Variable Space
  404.     KeyValSize = 1024                                       ' Mark Variable Size
  405.     
  406.     '------------------------------------------------------------
  407.     ' Retrieve Registry Key Value...
  408.     '------------------------------------------------------------
  409.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
  410.                          KeyValType, tmpVal, KeyValSize)    ' Get/Create Key Value
  411.                         
  412.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Errors
  413.     
  414.     If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then           ' Win95 Adds Null Terminated String...
  415.         tmpVal = Left(tmpVal, KeyValSize - 1)               ' Null Found, Extract From String
  416.     Else                                                    ' WinNT Does NOT Null Terminate String...
  417.         tmpVal = Left(tmpVal, KeyValSize)                   ' Null Not Found, Extract String Only
  418.     End If
  419.     '------------------------------------------------------------
  420.     ' Determine Key Value Type For Conversion...
  421.     '------------------------------------------------------------
  422.     Select Case KeyValType                                  ' Search Data Types...
  423.     Case REG_SZ                                             ' String Registry Key Data Type
  424.         KeyVal = tmpVal                                     ' Copy String Value
  425.     Case REG_DWORD                                          ' Double Word Registry Key Data Type
  426.         For i = Len(tmpVal) To 1 Step -1                    ' Convert Each Bit
  427.             KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1)))   ' Build Value Char. By Char.
  428.         Next
  429.         KeyVal = Format$("&h" + KeyVal)                     ' Convert Double Word To String
  430.     End Select
  431.     
  432.     GetKeyValue = True                                      ' Return Success
  433.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  434.     Exit Function                                           ' Exit
  435.     
  436. GetKeyError:      ' Cleanup After An Error Has Occured...
  437.     KeyVal = ""                                             ' Set Return Val To Empty String
  438.     GetKeyValue = False                                     ' Return Failure
  439.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  440. End Function
  441.  
  442.  
  443.